﻿using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using MqttSample;
using System.Text;

await Host.CreateDefaultBuilder(args)
    .ConfigureAppConfiguration((hostBuilder, confBuilder) =>
    {
    })
    .ConfigureServices((host, services) =>
    {
        services.Configure<List<MqttClientOption>>(host.Configuration.GetSection("MqttClient"));
        Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
        services.AddHostedService<MqttHostedService>();
    }).Build().RunAsync();

